package com.yycx.module.bus.client.entity.hy;

import com.baomidou.mybatisplus.annotation.*;
import com.yycx.common.mybatis.base.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.yycx.common.mybatis.annotation.TableAlias;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 非两票订单表
 *
 * @author zyf
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bus_hyorder")
@TableAlias("ho")
public class HyOrder extends AbstractEntity {
    @ApiModelProperty(value = "主键")
    @TableId(value = "orderId", type = IdType.ASSIGN_ID)
    private String orderId;

    @ApiModelProperty(value = "单据编码")
    private String orderNo;

    @ApiModelProperty(value = "出库单号")
    private String outOrderNo;

    @ApiModelProperty(value = "父ID")
    private String parentId;

    @ApiModelProperty(value = "业务编码")
    private String businessCode;

    @ApiModelProperty(value = "业务区域")
    private String businessArea;

    @ApiModelProperty(value = "发货区域")
    private String sendArea;

    @ApiModelProperty(value = "发货区域")
    private String sendAreaId;

    /**
     * 订单申请流程实例ID
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String processInstanceId;

    /**
     * 结算申请流程实例ID
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String applyIncId;

    @ApiModelProperty(value = "单位ID")
    private Long companyId;

    @ApiModelProperty(value = "机构ID")
    private Long organizationId;

    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "海鹰部门编码")
    private String hyDeptNo;

    @ApiModelProperty(value = "业务员")
    private Long saleManId;

    @ApiModelProperty(value = "业务员唯一编码")
    private String saleManCode;

    @ApiModelProperty(value = "渠道商ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdF;

    @ApiModelProperty(value = "片区服务商")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdC;

    @ApiModelProperty(value = "商务经理")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdD;

    @ApiModelProperty(value = "商务总负责人")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdE;

    @ApiModelProperty(value = "业务员职务ID")
    private Long positionId;

    @ApiModelProperty(value = "业务员")
    private String saleManName;

    @ApiModelProperty(value = "资信方式")
    private Integer customBondType;

    @ApiModelProperty(value = "收款日期")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date takeDate;

    @ApiModelProperty(value = "收款金额")
    private BigDecimal takeAmount;


    @ApiModelProperty(value = "收款方式1 现款 2 余额抵扣,3:认款记录 4 资信")
    private Integer takeAmountType;

    @ApiModelProperty(value = "收款银行")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long bankId;
    /**
     * 购货方编码
     */
    private String customCode;

    /**
     * 购货方ID
     */
    private Long customId;

    /**
     * 预付款ID
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long customBalanceId;
    /**
     * 订单状态
     */
    private Integer orderState;

    /**
     * 订单类型
     */
    private String orderType;

    @ApiModelProperty(value = "制单日期")
    private Date createDate;


    @ApiModelProperty(value = "发(退)货日期")
    private Date sendDate;

    @ApiModelProperty(value = "出库打印次数")
    private Integer outPrintTag;

    @ApiModelProperty(value = "商品标签打印状态")
    private Integer outPrintTag2;

    @ApiModelProperty(value = "打印状态")
    private Integer printTag;

    @ApiModelProperty(value = "内勤")
    private Long userId;

    @ApiModelProperty(value = "开票员")
    private String nickName;

    @ApiModelProperty(value = "货款发票邮寄方式1:货票同行 2:单独邮寄")
    private Integer invoiceSendType;

    @ApiModelProperty(value = "货款发票类型 1:普票 2:专票")
    private Integer invoiceType;

    @ApiModelProperty(value = "是否可开票 已开票2 可开票1 不可开票0")
    private Integer invoiceState;

    @ApiModelProperty(value = "开票备注")
    private String invoiceRemark;

    @ApiModelProperty(value = "发货方式 现款1 预收款2 资保金 3 全额资信 4 ")
    private Integer sendType;

    @ApiModelProperty(value = "发货(收货)状态0:未发货(收货) 1:已发货(收货),退货单充当退货状态")
    private Integer sendState;

    @ApiModelProperty(value = "核算状态0:未核算 1:核算中,2:已核算")
    private Integer calculateState;

    @ApiModelProperty(value = "申请撤销流程:0 未申请 1:已申请")
    private Integer revokeState;


    @ApiModelProperty(value = "是否有省级结算:0 无 1:有")
    private Integer proLevel;

    @ApiModelProperty(value = "同步状态:0 未 1:已")
    private Integer syncTag;

    @ApiModelProperty(value = "订单录入方式:1 海鹰 2:结算系统")
    private Integer sourceType;


    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "审单备注")
    private String applyRemark;

    @ApiModelProperty(value = "合计数量")
    @TableField(exist = false)
    private BigDecimal totalNum;


    @ApiModelProperty(value = "销售金额")
    private BigDecimal totalSaleAmount;

    @ApiModelProperty(value = "票折金额")
    private BigDecimal totalDiscountAmount;

    @ApiModelProperty(value = "资保金应收")
    private BigDecimal totalBondAmount;


    @ApiModelProperty(value = "账户抵扣金额")
    private BigDecimal useBalanceAmount;

    @ApiModelProperty(value = "账户结余金额")
    private BigDecimal surplusBalanceAmount;

    @ApiModelProperty(value = "是否有提成")
    private Integer rebateState;


    /**
     * 收货地址
     */
    private String customAddress;

    /**
     * 收货人
     */
    private String customUserName;

    /**
     * 收货人电话
     */
    private String customUserTel;


    /**
     * 创建订单的主机名称
     */
    private String hostName;

    /**
     * 随货资料
     */
    private String sendRemark;

    /**
     * 退货原因
     */
    private String reason;

    /**
     * 招商产品所属区域ID
     */
    @TableField(exist = false)
    private Long proId;

    /**
     * 销售审批信息
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String commentsXs;

    /**
     * 商务信息
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String commentsSw;

    /**
     * 财务审批信息
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String commentsCw;

    /**
     * 部门类型
     */
    @TableField(exist = false)
    private String deptType;

    /**
     * 收款信息
     */
    @TableField(exist = false)
    private String bankLists;

    @ApiModelProperty(value = "是否有税率差")
    @TableField(exist = false)
    private Integer hasTaxRateDiff;

}
